$gh-gray: #f5f5f5
$gh-dark: #333333
$gh-border-light: #EEEEEE
$gh-border-dark: #DDDDDD
$gh-text-color: #888888
$gh-highlight-color: #FFFFC6
$gh-primary-color: #3879D9

.aa-popup
  .aa-popup-content
    padding: 20px
  h1
    text-align: center
    font-size: 1em
    line-height: 4em
    border-bottom: solid 1px $gh-border-light
    margin: 0
  h2
    float: left
    width: 100%
    margin: 1.8em 0 .5em
    font-size: 1.2em
    font-weight: 200
    color: $gh-text-color
  p
    float: left
    font-size: 1em
    line-height: 1.5em
    margin: .5em 0
    color: $gh-dark
  ul
    float: right
    list-style: none
    margin: 0
    padding: 10px 0 0
    li
      display: inline-block
      margin-left: 10px
      line-height: 2em
  button
    width: 100%
    font-size: 1.2em
    border-radius: 3px
    background-color: $gh-primary-color
    border: solid 1px darken(#3879D9,10%)
    color: white
    padding: 5px 10px
    cursor: pointer
    img
      vertical-align: bottom
  .aa-algolia-logo
    clear: both
    width: 100px
    display: block
    margin: 0 auto
    img
      width: 100%
  a
    color: $gh-primary-color
    text-decoration: none
    &:hover
      text-decoration: underline
  a:focus, button:focus
    outline: 0 !important
    box-shadow: none !important


// common
.awesome-autocomplete
  position: relative
  .tt-input
    width: 100%
    border: 0
  .tt-hint
    color: #999
  .tt-cursor
    background-color: #FFF9EA

  .tt-dropdown-menu
    font-weight: normal
    padding: 0
    border: 1px solid $gh-border-dark
    border-top: none
    background-color: white
    box-shadow: 0 3px 12px rgba(0,0,0,0.15)
    box-sizing: border-box;
    .octicon
      color: $gh-text-color
    .octicon.octicon-star
      vertical-align: middle
    .aa-query
      padding: 8px
      color: $gh-text-color
      display: block
      width: 100%
      white-space: nowrap
      overflow: hidden
      text-overflow: ellipsis
      .aa-query-cursor strong, .aa-query-default em
        color: $gh-dark
    .aa-branding
      padding: 10px
      text-align: right
      font-size: .9em
      color: $gh-text-color
      img
        height: 18px
        vertical-align: bottom
      svg
        margin-bottom: -4px
    .aa-category
      padding: 5px 8px
      font-weight: bold
      text-align: left
      background-color: $gh-gray
      color: $gh-text-color
    .tt-suggestion
      padding: 10px 10px
      text-align: left
      border-bottom: 1px solid $gh-border-light
      cursor: pointer
      &:last-child
        border-bottom: 0
      em
        font-style: normal
        background-color: $gh-highlight-color
        color: $gh-dark
      .aa-suggestion
        &:hover
          text-decoration: none
          .aa-name
            text-decoration: underline
        .aa-infos
          float: right
          line-height: 3em
          color: $gh-text-color
          font-size: .9em
          i
            font-size: 14px
        .aa-name
          font-size: 1.1em
        &.aa-user
          height: 35px
          .aa-thumbnail
            float: left
            position: relative
            top: 3px
            width: 30px
            height: 30px
            margin-right: 10px
            border-radius: 3px
            overflow: hidden
            background-color: $gh-gray
            img
              width: 100%
          .aa-name
            font-weight: bold
          .aa-login
            color: $gh-text-color
          .aa-company
            color: $gh-dark
            i
              font-size: 14px
              color: $gh-text-color
        &.aa-repo
          height: 3em
          .aa-thumbnail
            float: left
            position: relative
            top: 3px
            width: 30px
            height: 30px
            margin-right: 10px
            border-radius: 3px
            overflow: hidden
            background-color: $gh-gray
            img
              width: 100%
          .aa-name
            display: block
            white-space: nowrap
            overflow: hidden
            text-overflow: ellipsis
            font-weight: normal
          .aa-repo-name
            font-weight: bold
          .aa-description
            height: 1.3em
            display: block
            white-space: nowrap
            overflow: hidden
            text-overflow: ellipsis
            color: $gh-text-color
        &.aa-issue
          .aa-thumbnail
            float: left
            position: relative
            top: 3px
            width: 30px
            height: 30px
            margin-right: 10px
            border-radius: 3px
            overflow: hidden
            background-color: $gh-gray
            img
              width: 100%
          .aa-name
            display: block
            white-space: nowrap
            overflow: hidden
            text-overflow: ellipsis
            font-weight: normal
          .aa-repo-name
            color: $gh-text-color
          .aa-issue-number
            font-weight: bold
            color: $gh-text-color
          .aa-issue-body
            clear: both
            color: $gh-text-color
            overflow: hidden
            text-overflow: ellipsis
        &.aa-your-repo
          height: 1.5em
          .aa-name
            width: 85%
            display: block
            white-space: nowrap
            overflow: hidden
            text-overflow: ellipsis
            font-weight: normal
            .aa-repo
              font-weight: bold
          i
            font-size: 14px
    .tt-dataset-current-repo
      .tt-suggestion
        padding: 0
  .icon-delete
    -webkit-transition: opacity 80ms
    transition: opacity 80ms
    position: absolute
    padding: 0
    margin: 0
    display: block
    right: 6px
    bottom: 5px
    height: 16px
    width: 16px
    z-index: 100
    opacity: 0
    visibility: hidden
    &.active
      opacity: .5
      visibility: visible
  &.flex-table-item
    .icon-delete
      bottom: 8px
      right: 22px

// top-menu search bar
.js-site-search
  .awesome-autocomplete
    .twitter-typeahead
      width: 100%
      .tt-dropdown-menu
        margin-top: 6px
        width: 360px
.js-site-search.scoped-search
  .header-search-wrapper
    position: relative
  .awesome-autocomplete
    .twitter-typeahead
      position: static
      width: 162px
      .tt-dropdown-menu
        width: 360px
.site-header-nav-secondary
  .js-site-search-form
    .awesome-autocomplete
      .twitter-typeahead
        width: 160px
        .tt-dropdown-menu
          width: 360px
      .icon-delete
        bottom: 8px
.site-header-nav-secondary .js-site-search-form .awesome-autocomplete .twitter-typeahead .tt-dropdown-menu
  margin-left: -200px
.js-site-search .awesome-autocomplete.repo-scope .twitter-typeahead .tt-dropdown-menu
  margin-left: -110px
.js-site-search .awesome-autocomplete.org-scope .twitter-typeahead .tt-dropdown-menu
  margin-left: -122px
// results page search bar
form#search_form
  .awesome-autocomplete
    .twitter-typeahead
      width: inherit
      .tt-input
        padding: 7px 8px !important
        border: 1px solid $gh-border-dark
        &:focus
          border-color: #51a7e8
          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(81, 167, 232, 0.5);
      .tt-dropdown-menu
        width: 100%
.pagehead .repohead-details-container ul.pagehead-actions
  z-index: initial
